package com.sf.hackathons.app.ui.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import com.sf.hackathons.app.R;

import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by 01367478 on 2017/12/15.
 */

public class ShareDialogActivity extends Activity {

    @OnClick({R.id.btn_sharefriends,R.id.btn_sharewechats,R.id.image_cancel})
    void onClick(View view){
        switch (view.getId()){
            case R.id.btn_sharefriends:

                break;
            case R.id.btn_sharewechats:
                openGenerateQrCode();
                break;
            case R.id.image_cancel:
                this.finish();
                break;
        }
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sharedailog);
        ButterKnife.bind(this);

        Window dialogWindow = getWindow();
        WindowManager.LayoutParams lp = dialogWindow.getAttributes();
        lp.width = lp.MATCH_PARENT; // 宽度设置为屏幕的0.65
        lp.height = lp.WRAP_CONTENT;
        dialogWindow.setAttributes(lp);
        dialogWindow.setGravity(Gravity.CENTER);
        setFinishOnTouchOutside(true);
    }

    private void openGenerateQrCode(){
        Intent intent = getIntent();
        intent.setClass(this, QRCodeActivity.class);
        startActivity(intent);
    }

}
